<?php
namespace app\api\controller\service;

use app\common\controller\Api;

/**
 * 首页接口
 */
class SkillCate extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 获取服务分类
     * @return void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getList()
    {
        $list = model('app\api\model\service\SkillCate')
            ->where(['state'=>1])
            ->field('id,name')
            ->cache(true,60)
            ->select();
        !$list && $this->error('管理员未设置服务分类');
        $this->success('信息返回成功',$list);
    }


}
